[dabo-users] toolbar background color

2015-04-08 Thread john

Hi,
I'm trying to change the background color of a dToolbar.  The toolbar is 
unique in that when I attempt to set the background color using
toolbar.SetBackgroundColour('yellow') the method either does nothing or 
returns a traceback



TypeError: in method 'Window_SetOwnBackgroundColour', expected argument 
1 of type 'wxWindow *'



There is something unique with the toolbars!  A toolbar is really not 
part of the form.


First question:  Where is the color set for the dToolbar?

Second:  Where is the main form setting the color?

Johnf




--- StripMime Report -- processed MIME parts ---
multipart/alternative
 text/plain (text body -- kept)
 text/html
---
___
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/5525354b.9070...@jfcomputer.com


Re: [dabo-users] toolbar background color

2015-04-08 Thread john



On 04/08/2015 07:41 AM, Paul McNett wrote:

On 4/8/15 7:20 AM, john wrote:

Testing directly with wxPython reveals this is NOT a Dabo issue. Using
code to add a toolbar reveals that I can not change the background color
completely only the border of the added object/s (does not work with
buttons - could be due to the lack of a border with buttons).
Again toolbars are unique.


Here's what I remember, the toolbar needs to be instantiated with the 
color you want, and I think we handled the reinstantiation for you in 
dabo. Have you tried mytoolbar.BackColor=(23,43,5)?


Paul


Thanks for responding.  I have tried several ways including yours. I 
think this has something to do with wxPython and not Dabo.
Try the below code (it only takes a second) and note that yellow appears 
around the textbox but not around the rest of the panel/frame of the 
toolbar.


import wx

ID_TIMER = 1
ID_EXIT  = 2
ID_ABOUT = 3
ID_BUTTON = 4

class Isabelle(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)

self.timer = wx.Timer(self, ID_TIMER)
self.blick = 0

file = wx.Menu()
file.Append(ID_EXIT, 'Quit\tCtrl+Q', 'Quit Isabelle')

help = wx.Menu()
help.Append(ID_ABOUT, 'About', 'O Programe')


menubar = wx.MenuBar()
menubar.Append(file, 'File')
menubar.Append(help, 'Help')
self.SetMenuBar(menubar)

toolbar = wx.ToolBar(self, -1)
toolbar.SetBackgroundColour('yellow')
self.tc = wx.TextCtrl(toolbar, -1, size=(100, -1))
btn = wx.Button(toolbar, ID_BUTTON, 'Ok', size=(40, 28))

toolbar.AddControl(self.tc)
toolbar.AddSeparator()
toolbar.AddControl(btn)
toolbar.Realize()
self.SetToolBar(toolbar)

self.Bind(wx.EVT_BUTTON, self.OnLaunchCommandOk, id=ID_BUTTON)
self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_ABOUT)
self.Bind(wx.EVT_MENU, self.OnExit, id=ID_EXIT)
self.Bind(wx.EVT_TIMER, self.OnTimer, id=ID_TIMER)

self.panel = wx.Panel(self, -1, (0, 0), (500 , 300))
self.panel.SetBackgroundColour('GRAY')
self.sizer=wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.panel, 1, wx.EXPAND)
self.SetSizer(self.sizer)
self.statusbar = self.CreateStatusBar()
self.statusbar.SetStatusText('Welcome to Isabelle')
self.Centre()
self.Show(True)

def OnExit(self, event):
dlg = wx.MessageDialog(self, 'Are you sure to quit Isabelle?',
   'Please Confirm', wx.YES_NO | 
wx.NO_DEFAULT | wx.ICON_QUESTION)

if dlg.ShowModal() == wx.ID_YES:
self.Close(True)


def OnAbout(self, event):
dlg = wx.MessageDialog(self, 'Isabelle\t\n' '2004\t', 'About',
   wx.OK | wx.ICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()


def OnLaunchCommandOk(self, event):
input = self.tc.GetValue()
if input == '/bye':
self.OnExit(self)
elif input == '/about':
self.OnAbout(self)
elif input == '/bell':
wx.Bell()
else:
self.statusbar.SetBackgroundColour('RED')
self.statusbar.SetStatusText('Unknown Command')
self.statusbar.Refresh()
self.timer.Start(50)

self.tc.Clear()

def OnTimer(self, event):
self.blick = self.blick + 1
if self.blick == 25:
self.statusbar.SetBackgroundColour('#E0E2EB')
self.statusbar.Refresh()
self.timer.Stop()
self.blick = 0

app = wx.App()
Isabelle(None, -1, 'Isabelle')
app.MainLoop()

___
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/552540ab.7010...@jfcomputer.com


Re: [dabo-users] toolbar background color

2015-04-08 Thread john
Testing directly with wxPython reveals this is NOT a Dabo issue. Using 
code to add a toolbar reveals that I can not change the background color 
completely only the border of the added object/s (does not work with 
buttons - could be due to the lack of a border with buttons).

Again toolbars are unique.
Johnf

On 04/08/2015 07:03 AM, john wrote:

Hi,
I'm trying to change the background color of a dToolbar.  The toolbar 
is unique in that when I attempt to set the background color using
toolbar.SetBackgroundColour('yellow') the method either does nothing 
or returns a traceback



TypeError: in method 'Window_SetOwnBackgroundColour', expected 
argument 1 of type 'wxWindow *'



There is something unique with the toolbars!  A toolbar is really not 
part of the form.


First question:  Where is the color set for the dToolbar?

Second:  Where is the main form setting the color?

Johnf






--- StripMime Report -- processed MIME parts ---
multipart/alternative
 text/plain (text body -- kept)
 text/html
---
___
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/55253926.8060...@jfcomputer.com


Re: [dabo-users] toolbar background color

2015-04-08 Thread Paul McNett

On 4/8/15 7:20 AM, john wrote:

Testing directly with wxPython reveals this is NOT a Dabo issue. Using
code to add a toolbar reveals that I can not change the background color
completely only the border of the added object/s (does not work with
buttons - could be due to the lack of a border with buttons).
Again toolbars are unique.


Here's what I remember, the toolbar needs to be instantiated with the 
color you want, and I think we handled the reinstantiation for you in 
dabo. Have you tried mytoolbar.BackColor=(23,43,5)?


Paul


___
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/55253e0d.1060...@mcnettware.com