system-modal dialogs?

Agreed. I wasn't thinking. I should have asked whether I can make it always
on top (in view) even when changing focus to another app?

Bruce

···

-----Original Message-----
From: Chris Barker [mailto:Chris.Barker@noaa.gov]
Sent: Wednesday, November 13, 2002 10:32 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] system-modal dialogs?

brucedickey wrote:

I made a wxDialog and said ShowModal(). It acts like an app-modal dialog.
How can I make it system-modal? I.e., the user cannot change focus to
another app while the dialog is up?

You can't. At least you can't on *nix, and I sure hope you can't on
modern versions of Windows. System Modal dialog boxes are horrible,
horrible things. How do you know what else the user might be doing with
his/her machine? System modal dialog boxes are the thing I swear at most
oftem with MacOS (and there are quite a few things I swear at with that
system!)

-Chris

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Here's some sample code, based on advice from this list some time back. It
works for me on Win98, Win2K and WinXP.

class MyApp(wxApp):
    def OnInit(self):

        frame = MyFrame(NULL, -1, "Hi There!")
        frame.Show(true)

##This is the important line
        self.SetTopWindow(frame)

        return true

app = MyApp(0)
app.MainLoop()

HTH,

John Hopkins

···

----- Original Message -----
From: "brucedickey" <brucedickey@micron.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Wednesday, November 13, 2002 9:51 AM
Subject: RE: [wxPython-users] system-modal dialogs?

Agreed. I wasn't thinking. I should have asked whether I can make it

always

on top (in view) even when changing focus to another app?

Bruce

-----Original Message-----
From: Chris Barker [mailto:Chris.Barker@noaa.gov]
Sent: Wednesday, November 13, 2002 10:32 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] system-modal dialogs?

brucedickey wrote:
> I made a wxDialog and said ShowModal(). It acts like an app-modal

dialog.

> How can I make it system-modal? I.e., the user cannot change focus to
> another app while the dialog is up?

You can't. At least you can't on *nix, and I sure hope you can't on
modern versions of Windows. System Modal dialog boxes are horrible,
horrible things. How do you know what else the user might be doing with
his/her machine? System modal dialog boxes are the thing I swear at most
oftem with MacOS (and there are quite a few things I swear at with that
system!)

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Hi all,

I have a number of places where I use a wxChoice, and I want it to be
sized large enough for even the largest of possible choices to be
displayed. When I pass the list of choices in on creation like this:

SampleChoice = wxChoice(self, ID_Choice,
wxDefaultPosition,wxDefaultSize,ListOfChoices)

and then add it to a Horizontal Box sizer like this:

Box.Add(SAmpleChoice,0, wxALIGN_RIGHT)

It works just like I like with wxGTK, but on wxMSW and wxMac, the
control seems to be set to some standard size, which is not large enough
for the longer strings in my ListOfChoices.

How do I get it to size itself properly on all platforms.

Also, if I add stuff the wcChoice with an Append, for instance, how do
Iget it to re-size itself?

Another note. On wxGTK, the first item in the choices list is displayed
by default. Under MacOS-X, nothing is displayed. Is this a differnce in
the native controls? Should I be calling SetSelection?

-Thanks,

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I need the notebook tabs to show tabs on top like it shows when i use
wxNB_RIGHT...

… tabs on top of other tabs and not using arrow to select tabs…
is it possible???
Thanks!

Hi all,

I need to line up a few controls in a grid pattern, so a FlexGridSizer
seemed to be just the ticket. My first stab went pretty well, but when I
tired to make it look a little nicer, I cam up with what really looks
like a kludge, so I'm hoping there is a better way.

It has to do with space between the items. I know I can add space
between rows and columsn, so I did that, which works just fine, but I
wanted the space to be a little differnt betweena particualr two rows,
so I added a whole row of just spacers. Then I wanted a little space
around the whole thing, and all I could come up with is putting a
complete set of rows and columns around the whoel thing, and filling all
that with spacers. The result is a WHOLE lot of spacers.

What I seem to be yearning for is something more like what you can do
with box sizers, with the "option" argument and the flags for wxGROW,
etc. The problem is that those are set up for a one-directional box, and
a grid has two directions, Anyway, this is what I've got. Is there a
cleaner way to lay this out? I've enclosed the code and a PNG of what it
looks like, which is pretty much what I want.

-Chris

sizer_test.py (4.73 KB)

layout.gif

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

John Hopkins wrote:

Here's some sample code, based on advice from this list some time back. It
works for me on Win98, Win2K and WinXP.

class MyApp(wxApp):
    def OnInit(self):

        frame = MyFrame(NULL, -1, "Hi There!")
        frame.Show(true)

##This is the important line
        self.SetTopWindow(frame)

No, this just adds the window to the list of top level windows in the app. It doesn't do anything to it in the GUI.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Chris Barker wrote:

It works just like I like with wxGTK, but on wxMSW and wxMac, the
control seems to be set to some standard size, which is not large enough
for the longer strings in my ListOfChoices.

How do I get it to size itself properly on all platforms.

Also, if I add stuff the wcChoice with an Append, for instance, how do
Iget it to re-size itself?

Try choice.SetSize(choice.GetBestSize())

Another note. On wxGTK, the first item in the choices list is displayed
by default. Under MacOS-X, nothing is displayed. Is this a differnce in
the native controls?

Probably.

Should I be calling SetSelection?

If you want an item preselected, yes.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Tiago Duarte Felix wrote:

I need the notebook tabs to show tabs on top like it shows when i use
wxNB_RIGHT...

... tabs on top of other tabs and not using arrow to select tabs...
is it possible???

There is a wxNB_MULTILINE style, but I thnik it is only supported on MSW.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Chris Barker wrote:

Hi all,

I need to line up a few controls in a grid pattern, so a FlexGridSizer
seemed to be just the ticket. My first stab went pretty well, but when I
tired to make it look a little nicer, I cam up with what really looks
like a kludge, so I'm hoping there is a better way.

It has to do with space between the items. I know I can add space
between rows and columsn, so I did that, which works just fine, but I
wanted the space to be a little differnt betweena particualr two rows,
so I added a whole row of just spacers.

Yes, this is the right thing to do in this case.

Then I wanted a little space
around the whole thing, and all I could come up with is putting a
complete set of rows and columns around the whoel thing, and filling all
that with spacers.

For this a better thing to do is to put the wxFlexGridSizer into a wxBoxSizer specifiying a wxALL flag and a border.

What I seem to be yearning for is something more like what you can do
with box sizers, with the "option" argument and the flags for wxGROW,
etc. The problem is that those are set up for a one-directional box, and
a grid has two directions,

You can use the AddGrowableRow and AddGrowableColumn methods to define which rows and/or columns are growable and will have the excess space divided amongst them.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

> Also, if I add stuff the wcChoice with an Append, for instance, how do
> Iget it to re-size itself?

Try choice.SetSize(choice.GetBestSize())

Thanks, Robin, that's a start. It works if I put the wxChoice all alone
in a wxFrame, but I can't seem to get it to work in a wxSizer. No matter
what I've tried, it stays the same size as when it is created. I've
enclosed a simple test app with a wxChoice (and a wxStaticText) in a
wxBoxSizer, on a Panel, in a Frame. I can re-size the Frame and all the
expected things happen, but the wxChoice does not size itself to fit
it's elements.

I do a Choice.Append() after putting the Choice in the sizer, but before
initializing the frame, and also after it's all be created. Neither one
changes the size, even after calling:

choice.SetSize(choice.GetBestSize())

I suspect I'm missing something about how sizers work, rather than
anything about wxChoice, but either way, I'm stumped.

-Thanks,
-Chris

wxChoice_test.py (1.73 KB)

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Chris Barker wrote:

Robin Dunn wrote:

Also, if I add stuff the wcChoice with an Append, for instance, how do
Iget it to re-size itself?

Try choice.SetSize(choice.GetBestSize())

Thanks, Robin, that's a start. It works if I put the wxChoice all alone
in a wxFrame, but I can't seem to get it to work in a wxSizer. No matter
what I've tried, it stays the same size as when it is created. I've
enclosed a simple test app with a wxChoice (and a wxStaticText) in a
wxBoxSizer, on a Panel, in a Frame. I can re-size the Frame and all the
expected things happen, but the wxChoice does not size itself to fit
it's elements.

The sizer by default will take the initial size as the item's minimum size. (This may be changing...) So you want to tell the sizer that the item has a new minimum size. Try

  sizer.SetItemMinSize(choice.GetBestSize())

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

The sizer by default will take the initial size as the item's minimum
size. (This may be changing...) So you want to tell the sizer that the
item has a new minimum size. Try

        sizer.SetItemMinSize(choice.GetBestSize())

Well, that gave me an error, but this worked:

Sizer.SetItemMinSize(Choice,Choice.GetBestSize()[0],Choice.GetBestSize()[1])

This does seem likekind of a hack, but it does work. You make reference
to "that may be changing". what's in the works? It seems even if nothing
fancier is done, a single call to tell a Sizer to go recheck the
BestSize of all it's children would be nice. Or maybe an event that a
window would emit when it's BestSize changes, that would be caught by
all the sizers above it.

Anyway, I have a fix. Once again, Robin, you have provided the best tech
support available on the planet.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov